package br.com.cartools.entity.payment;


public class MoneyPayment implements IPayment{

	private static final Integer MONEY_PAYMENT_METHOD = PaymentMethod.MONEY; 
	private boolean paymentStatus;
	
	public MoneyPayment(){
		paymentStatus = false;
	}
	
	@Override
	public Double getCashBack(Double billValue, Double receivedMoney) {
		if (paymentStatus && receivedMoney > billValue) return receivedMoney - billValue;
		throw new IllegalArgumentException("Should have cash back just for money.");
	}

	@Override
	public boolean paymentMethod(Integer method) {
		if (MONEY_PAYMENT_METHOD == method) {
			this.paymentStatus = true;
		}
		return this.paymentStatus;
	}

	@Override
	public boolean setLots(Integer x) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public Double valueInLots() {
		// TODO Auto-generated method stub
		return null;
	}

}
